/**
 * @ngdoc service
 * @name app.service:DataSharingObject
 * @description
 * This service create an object for storing data to share between directives <br>
 * @property {Object} userProfile An object store user profile.
 * @property {Object} userAdditionalProperties An object store user additional properties.
 * @property {Object} selectedMenu An object store selected menu
 * @property {Object} currentToolbar An object store selected toolbar.
 */

appSkeleton.factory('DataSharingServiceSkeleton',function(){
    'use strict';
	var userProfile;
    var userAdditionalProperties;
    var selectedMenu;
    var currentToolbar;
    var companyParameter;
    var selectedTheme;
    var textSearchValidation = '';
    var employeeSelected;

    return {

        getUserProfile: function(){
            return userProfile;
        },
        setUserProfile: function(usr){
          /*  usr.permissions = [];
            var per1 = {code:'MANAGE_OWN_EXPENSE'};
            var per2 = {code:'MANAGE_OTHERS_EXPENSE'};
            var per3 = {code:'VALIDATE_EXPENSE'};
            usr.permissions.push(per1);
            usr.permissions.push(per2);
            usr.permissions.push(per3);*/
            userProfile = usr;
        },
        setUserAdditionalProperties: function(userAdd){
           userAdditionalProperties = userAdd;
        },
        getUserAdditionalProperties: function(){
            if (userAdditionalProperties == undefined) {
                userAdditionalProperties = {};
            }
            return userAdditionalProperties;
        },
        setSelectedMenu: function(menuItem){
            selectedMenu = menuItem;
        },
        getSelectedMenu: function(){
            return selectedMenu;
        },
        setCurrentToolbar: function(toolbar){
            currentToolbar = toolbar;
        } ,
        getCurrentToolbar: function(){
            return currentToolbar;
        },
        setCompanyParameter: function(params){
            companyParameter = params;
        },
        getCompanyParameter: function(){
            return companyParameter;
        },
        setSelectedTheme: function(theme){
            selectedTheme = theme;
        },
        getSelectedTheme: function(){
            return selectedTheme;
        },
        setTextSearchValidation: function(text){
            textSearchValidation = text;
        },
        getTextSearchValidation: function(){
            return textSearchValidation;
        },
        setEmployeeSelected: function(employee){
            employeeSelected = employee;
        },
        getEmployeeSelected: function(){
            return employeeSelected;
        }
    };
});